let filterNumber = function(value) {
        if (!value) return '0.00';
        value = value.toString();
        var intPart = 0; //整数位
        var intPartFormat = 0; //分段之后的处理
        //是否为负数
        var isMinus = false;
        if (value.indexOf("-") == 0) {
            isMinus = true;
            var temp = value.toString().split('-');
            value = temp[1];
        }
        //是否有小数位没有则补00;
        if (value.indexOf(".") == -1) {
            intPart = Math.floor(value); //获取整数部分
            intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); //将整数部分逢三一断
            value = intPartFormat + '.00';
        } else {
            var newArr = value.toString().split('.');
            var decimal = newArr[1]; //小数位
            intPart = Math.floor(newArr[0]); //获取整数部分
            intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); //将整数部分逢三一断
            // console.log('newArr',newArr)
            if (decimal.length == 0) {
                value = intPartFormat + '.00';
            } else if (decimal.length == 1) {
                value = intPartFormat + '.' + decimal + '0';
            } else {
                value = intPartFormat + '.' + decimal;
                value = value.substring(0, value.indexOf(".") + 3);
            }
        }
        if (isMinus) {
            value = '-' + value;
        }
        // console.log('最后的数据>>',value)
        return value;
    }
    //银行卡号尾数大于四位一空格
let filtersCard = function(value) {
    if (!value) return;
    value = value.toString();
    if (value.length > 4) {
        value = value.replace(/\s/g, '').replace(/....(?!$)/g, '$& ');
    }
    return value
}
export {
    filterNumber,
    filtersCard
}